package com.jgp.glmeeting.controller;

import com.jgp.glmeeting.model.Invoice;
import com.jgp.glmeeting.service.InvoiceService;
import com.jgp.sys.common.controller.JGPController;
import com.jgp.sys.ui.GridResult;
import com.jgp.sys.ui.Pager;
import com.jgp.sys.ui.Result;
import com.jgp.sys.ui.annotation.UIParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/glMeeting/invoiceApiController")
public class InvoiceApiController extends JGPController {
    @Autowired
    private InvoiceService invoiceService;




    //处理发票所有和分页
    @RequestMapping("/queryInvoice")
    public Result queryInvoice(Invoice i, @UIParam("pager") Pager pager){
        List<Invoice> lists=invoiceService.queryInvoice(i,pager);
        List<GridResult.Category> categories = new ArrayList<>();
        categories.add(new GridResult.Category(  "姓名",  "participantName"));

        categories.add(new GridResult.Category("手机号",  "mobilePhone"));
        categories.add(new GridResult.Category("入住时间",  "checkInTime"));

        return ajaxRe("gdata",categories,lists,pager);
    }

}
